package aboutclass;


import java.util.Arrays;

public class StringDemo {
  public static void main(String[] args) {
    char[] chs = {'a','b','d','f','g'};
    char c = 'c';
    chs = Arrays.copyOf(chs, chs.length+1);
    chs[5] = chs[4];
    chs[4] = chs[3];
    chs[3] = chs[2];
    chs[2] = c;
    System.out.println(chs);
    
    StringBuilder buf = new StringBuilder("abdfg");
    buf.insert(2, 'c');
    System.out.println(buf);
    
    
  }

}